package com.liruo.treasureattic.starter.oss.client;

import com.liruo.treasureattic.starter.oss.model.future.UploadFuture;

import java.io.File;
import java.util.List;
import java.util.Map;

/**
 * @Author:liruo
 * @Date:2023-02-18-11:25:33
 * @Desc
 */
public interface OssClient{
    /**
     * @param key   对象在存储桶里的文件路径
     * @return
     */
    void uploadAsync(byte[] bytes, String key);
    void uploadAsync(File file, String key);

    UploadFuture uploadAsyncR(byte[] bytes, String key);
    UploadFuture uploadAsyncR(File file, String key);

    /**
     * Object=byte[] or File
     */
    void multiUploadAsync (Map<String, Object> map);
    /**
     * 等待最后一个上传完
     * Object=byte[] or File
     */
    void multiUploadWaitLast(Map<String, Object> map);

    /**
     * 下载到本地
     * @param key
     * @param destFilePath 本地路径
     */
    void downloadToLocal(String key, String destFilePath);

    /**
     * @param key
     * @return 单纯地用defaultBucket.cos.region.region.myqcloud.com/OssKey
     */
    String getUrl(String key);
    List<String> multiGetUrl(List<String> keys);
}
